ÂQuickDraw GX PrintingContentsFigures, Tables, and ListingsAbout This Book5Figure P-1 Roadmap to the QuickDraw GX suite of booksWhat to ReadChapter OrganizationConventions Used in This BookSpecial FontsTypes of NotesNumerical Formats!Type Definitions for EnumerationsIllustrationsDevelopment EnvironmentFor More Information*Introduction to Printing With QuickDraw GXAbout QuickDraw GX Printing'Figure 1-1 QuickDraw GX printing phasesCore Printing-Related Objects0Figure 1-2 QuickDraw GX printing-related objectsDesktop Printers8Figure 1-3 Dragging a document to a desktop printer iconPrint FilesPrinter Drivers5Figure 1-4 Default QuickDraw GX desktop printer iconsPrinting ExtensionsDialog BoxesFigure 1-5 The Print dialog box(Figure 1-6 The expanded Print dialog boxFigure 1-7 The Print Time panel Figure 1-8 The Paper Match panelMessage Passing.Figure 1-9 Message handlers in a message chain2Figure 1-10 Overriding the gxPrintingEvent message,About QuickDraw GX Printing-Related ObjectsJob ObjectsFormat ObjectsPFigure 1-11 Effect of specifying a shape in the form property of a format objectPaper-Type Objects9Figure 1-12 A paper type for printing on letterhead paperCollection ObjectsPrinter ObjectsPrint File Objects0Summary of QuickDraw GX Printing-Related Objects1Figure 1-13 QuickDraw GX printing-related objects/Table 1-1 QuickDraw GX printing-related objects?Using Printing-Related Objects With Other QuickDraw GX ObjectsShape ObjectsTag ObjectsView Port ObjectsView Device Objects+Implementing QuickDraw GX Printing Features3Figure 1-14 Printing-related items in the File menuCore Printing FeaturesCFigure 1-15 Manipulating the job object in response to user actions*Customizing QuickDraw GX Printing Features;Figure 1-16 Printing a document containing multiple formatsAdvanced Printing Features1Compatibility With the Macintosh Printing ManagerCore Printing FeaturesAbout Core Printing Features=Figure 2-1 Objects needed to implement core printing featuresCore Print ObjectsJob Object PropertiesFigure 2-2 The job objectFormat Object PropertiesFigure 2-3 The format objectPaper-Type Object Properties Figure 2-4 The paper-type objectEdit Menu StructureUsing Core Printing Features"Initializing QuickDraw GX Printing.Creating a Job Object for a Printable Document:Listing 2-1 Creating a job object for a printable documentError Handling9Listing 2-2 Polling for errors after individual functions8Listing 2-3 Polling for errors after groups of functions*Supporting QuickDraw GX Print Dialog Boxes=Listing 2-4 Override function for the gxPrintingEvent message%Printing Documents Using QuickDraw GX'Printing Pages as Single Picture Shapes>Listing 2-5 Using the GXPrintPage function to print a document"Printing Pages by Capturing Shapes^Listing 2-6 Using the GXStartPage, GXDrawShape, and GXFinishPage functions to print a document(Saving a Job Object With a Document File&Saving a Job Object in a Single HandleEListing 2-7 Using the GXFlattenJobToHdl function to save a job object/Saving a Job Object Using a Flattening Function@Listing 2-8 Using the GXFlattenJob function to save a job object1Disposing of a Job Object When Closing a Document?Listing 2-9 Disposing of a job object when you close a document/Retrieving a Job Object When Opening a Document%Retrieving a Job Object From a HandleNListing 2-10 Using the GXUnflattenJobFromHdl function to retrieve a job object6Retrieving a Job Object Using an Unflattening FunctionGListing 2-11 Using the GXUnflattenJob function to retrieve a job objectObtaining Object ReferencesEListing 2-12 Using the GXGetFormatJob function to obtain a job object*Obtaining Information From a Format Object5Listing 2-13 Using the GXGetFormatDimensions function*Displaying QuickDraw GX Print Dialog Boxes$Displaying the Page Setup Dialog Box$Figure 2-5 The Page Setup dialog box-Figure 2-6 The expanded Page Setup dialog box1Listing 2-14 Displaying the Page Setup dialog boxDisplaying the Print Dialog BoxFigure 2-7 The Print dialog box(Figure 2-8 The expanded Print dialog box-Listing 2-15 Displaying the Print dialog box #Supporting Printing From the Finder[Listing 2-16 Responding to the Print Documents Apple event and specifying an output printerUpdating Job Object Information8Listing 2-17 Updating a job when receiving resume events-Printing Macintosh Printing Manager Documents8Listing 2-18 Converting a print record into a job object!Core Printing Features ReferenceConstants and Data TypesGestalt Selectors for Printing%QuickDraw GX Printing-Related ObjectsEdit Menu LocationDialog Box Results Functions;Initializing and Terminating QuickDraw GX Printing FeaturesGXInitPrintingGXExitPrintingHandling ErrorsGXGetJobErrorGXSetJobError!Creating and Managing Job ObjectsGXNewJobGXDisposeJobGXFlattenJobToHdlGXFlattenJobGXUnflattenJobFromHdlGXUnflattenJobGXUpdateJobPrinting With QuickDraw GXGXSelectJobOutputPrinterGXGetJobPageRange
GXStartJobGXPrintPageGXFinishJobGXStartPageGXFinishPage1Obtaining Information on Printing-Related ObjectsGXGetJobFormatGXGetFormatJobGXGetFormatDimensions0Displaying the Page Setup and Print Dialog BoxesGXInstallApplicationOverrideGXJobDefaultFormatDialogGXJobPrintDialogConverting a Print RecordGXConvertPrintRecordApplication-Defined FunctionsMessage Override FunctionsGXPrintingEvent5Flattening and Unflattening Functions for Job ObjectsMyFlattenFunctionMyUnflattenFunction"Summary of Core Printing Features,Page Formatting and Dialog Box Customization3About Page Formatting and Dialog Box CustomizationAbout Collection ObjectsCollection Tag IDs and Item IDsItem StructuresCategories of Collection ItemsThe Job CollectionFigure 3-1 The job collectionThe Format Collection Figure 3-2 The format collectionThe Paper-Type Collection$Figure 3-3 The paper-type collectionAbout Page FormattingMFigure 3-4 A three page document and its corresponding job and format objectsManipulating Format ObjectsEFigure 3-5 Manipulating the format object in response to user actionsMapping for Format Objects"Figure 3-6 Scaling a format objectForms and Format Objects(Figure 3-7 Using a form to format a page Halftones and Format CollectionsDialog Box CustomizationDFigure 3-8 The expanded Custom Page Setup dialog box with two panels1Table 3-1 Functions that enable dialog box panels5Table 3-2 Functions that forward a dialog box messageThe Dialog Box Panel Resource0Listing 3-1 A panel resource definition templateResponding to Panel EventsAutomating Panel Events?Listing 3-2 The extended item list resource definition template)Using Printing-Related Collection Objects'Accessing Data From a Collection ObjectCListing 3-3 Accessing copies information stored in a job collection<Using a Collection to Implement the Print One Copy Menu ItemRListing 3-4 Modifying the job collection to implement the Print One Copy menu itemReplacing Items in Collections&Listing 3-5 Replacing collection items,Specifying Page Ranges in the Job Collection+Listing 3-6 Setting up a default page range3Figure 3-9 Print dialog box with default page range/Listing 3-7 Setting up a replacement page range8Figure 3-10 Print dialog box with replacement page range.Listing 3-8 Setting up a customized page range7Figure 3-11 Print dialog box with customized page range9Using Format Objects and Collection Items to Format Pages1Creating a Format Object for a Page in a Document,Figure 3-12 The Custom Page Setup dialog box5Figure 3-13 The expanded Custom Page Setup dialog boxNFigure 3-14 A four-page document in which page two uses a unique format object=Listing 3-9 Creating a format object for a page in a document"Sharing Formats for Document PagesRFigure 3-15 A four-page document in which pages 2 and 3 use the same format object@Listing 3-10 Cloning a format object for two pages in a document5Disposing of a Format Object for a Page in a DocumentRFigure 3-16 A four-page document in which pages 2 and 3 use unique formats objectsYListing 3-11 Disposing of a format object for a page in a document and creating a new oneUsing Forms With Format Objects-Listing 3-12 Adding a form to a format object3Storing Halftone Information in a Format Collection@Listing 3-13 Storing halftone information in a format collection2Copying a Format Object for Use in Other Documents?Figure 3-17 Moving a format object from one document to another@Listing 3-14 Moving a format object from one document to another*Obtaining the Mapping From a Format Object0Listing 3-15 Obtaining a format object’s mapping6Obtaining a Paper-Type Object Associated With a FormatjFigure 3-18 A three-page document and its corresponding job object, format objects, and paper-type objectsLListing 3-16 Obtaining the paper-type object associated with a format object'Scanning Through a Job’s Format Objects4Listing 3-17 Using the GXForEachJobFormatDo function@Listing 3-18 Obtaining scaling information on each format object.Associating Format Objects With Document PagesgListing 3-19 Saving the correspondence between format objects and document pages in a format collectionListing 3-20 Filling the handlemListing 3-21 Retrieving the correspondence between document pages and format objects from a format collection%Customizing QuickDraw GX Dialog BoxesAdding Panels to Dialog Boxes#Listing 3-22 Setting up a new panelSetting Up Dialog Box Resources=Figure 3-19 A panel added to the Custom Page Setup dialog box"Listing 3-23 Sample panel resource&Listing 3-24 Sample item list resource#Listing 3-25 Sample 'CNTL' resource/Listing 3-26 Sample extended item list resource#Listing 3-27 Sample 'MENU' resourceParsing Page RangesMListing 3-28 Installing an override function for the gxParsePageRange message?Listing 3-29 Override function for the gxParsePageRange message6Page Formatting and Dialog Box Customization Reference%Constants for Loop Status Information4Constants for Collection Item Categories and Tag IDsCollection Item CategoriesCollection Tag ID1Constants and Data Types for Job Collection ItemsPrint-Job InformationCollation InformationCopies InformationPage-Range InformationQuality InformationFile-Destination InformationFile-Location InformationFile-Format InformationFile-Fonts InformationPaper-Feed InformationManual-Feed InformationStandard Mapping InformationSpecial Mapping InformationTray-Mapping InformationPrint-Panel InformationFormat-Panel InformationPaper-Mapping InformationTranslated-Document Information4Constants and Data Types for Format Collection ItemsOrientation InformationScaling InformationDirect-Mode InformationFormat-Halftone InformationPage-Inversion Information Horizontal Page-Flip InformationVertical Page-Flip InformationPrecise-Bitmap InformationPaper-Type Lock Information8Constants and Data Types for Paper-Type Collection ItemsBase InformationCreator InformationUnits InformationFlags InformationComment Information&Panel-Related Constants and Data TypesThe Panel Information StructurePanel EventsPanel ResponsesPanel Event ActionsThe Panel Setup StructurePrinting Panel KindsParse Range Results Functions(Creating and Manipulating Format ObjectsGXNewFormatGXDisposeFormatGXCopyFormatGXCloneFormatGXCountJobFormatsGXCountFormatOwnersGXForEachJobFormatDo%Manipulating Format Object PropertiesGXGetFormatMappingGXGetFormatPaperTypeGXGetFormatFormGXSetFormatFormGXChangedFormat+Displaying the Custom Page Setup Dialog BoxGXFormatDialogWorking With PanelsGXSetupDialogPanelGXGetJobPanelDimensionsGXEnableJobScalingPanelGXGetMessageHandlerResFile-Accessing Printing-Related Collection ObjectsGXGetJobCollectionGXGetFormatCollectionGXGetPaperTypeCollectionApplication-Defined FunctionsDMessage Override Functions for Customizing QuickDraw GX Dialog BoxesGXJobPrintDialogGXJobDefaultFormatDialogGXFormatDialogGXHandlePanelEventGXFilterPanelEventGXParsePageRangeLooping Through Format ObjectsDialog Box-Related ResourcesThe Panel ResourceFigure 3-20 Panel resourceThe Extended Item List Resource'Figure 3-21 Extended item list resourceFigure 3-22 Radio button items*Figure 3-23 Checkbox and pop-up menu items,Figure 3-24 Integer and real edit text items&Figure 3-25 String editable text items8Summary of Page Formatting and Dialog Box CustomizationAdvanced Printing Features About Advanced Printing FeaturesPrinter ObjectsFigure 4-1 The printer objectPrinter Driver TypesTable 4-1 Printer driver typesPrinter View DevicesColor Matching for PrintersPrint File Objects Figure 4-2 The print file objectSynonyms(Table 4-2 QuickDraw GX printing synonyms+General-Purpose PostScript Operator Synonym&PostScript Control Information SynonymDash SynonymLine Cap SynonymHalftone SynonymPattern SynonymCubic SynonymQuickDraw Picture SynonymPrinting Modes Table 4-3 Print job format modesPen Tables for Vector Devices Using Advanced Printing Features#Using Advanced Job Object Functions:Obtaining Printer and Printer Driver Information for a JobIListing 4-1 Obtaining the names and types of a printer and printer driver;Getting and Setting the Reference Constant for a Job Object@Listing 4-2 Setting the job object’s reference constant property@Listing 4-3 Getting the job object’s reference constant propertyCopying Job Object Information*Listing 4-4 Copying job object informationWorking With Printer Objects"Determining a Printer’s Resolution.Listing 4-5 Determining a printer’s resolution:Retrieving the Color Profile and Color Space for a PrinterBListing 4-6 Retrieving the printer’s color profile and color space?Listing 4-7 Using the printer’s color profile to convert colorsManipulating Print File Objects!Opening and Closing a Print File ,Listing 4-8 Opening and closing a print fileSaving a Print File )Obtaining the Job Object for a Print FileReading Print File Data,Listing 4-9 Reading a page from a print file"Counting the Pages in a Print File#Adding or Deleting Print File PagesDefining Different Paper SizesCreating a Paper-Type Object-Listing 4-10 Creating a new paper-type object"Obtaining the Name of a Paper Type1Listing 4-11 Obtaining a paper-type object’s name)Obtaining the Dimensions of a Paper Type HListing 4-12 Obtaining page and paper rectangles for a paper-type object,Scanning the Paper Types Available to a Job <Listing 4-13 Executing a function for each paper-type object=Listing 4-14 Executing a procedure for each paper-type object!Implementing Direct-Mode Printing,Formatting for Text Job Format Mode Printing,Table 4-4 Text job format mode query optionsUsing Synonyms$Advanced Printing Features Reference7Constants and Data Types for Advanced Printing FeaturesJob Format ModesText Job Format (Direct) ModeThe Status StructureTable 4-5 Status type IDsPen Tables for Vector Devices%Constants and Data Types for Synonyms+General-Purpose PostScript Operator Synonym&PostScript Control Information SynonymDash SynonymHalftone SynonymLine Cap SynonymPattern SynonymCubic SynonymQuickDraw Picture Synonym FunctionsAdvanced Job Object FunctionsGXSelectJobFormattingPrinterGXGetJobFormattingPrinterGXGetJobOutputPrinterGXGetJobRefConGXSetJobRefCon GXCopyJobManipulating Printer ObjectsGXGetJobPrinterGXGetPrinterJobGXForEachPrinterViewDeviceDoGXCountPrinterViewDevicesGXGetPrinterViewDeviceGXSelectPrinterViewDeviceGXGetPrinterDriverNameGXGetPrinterNameGXGetPrinterDriverTypeGXGetPrinterType%Working With QuickDraw GX Print FilesGXOpenPrintFileGXClosePrintFileGXGetPrintFileJobGXCountPrintFilePagesGXReadPrintFilePageGXReplacePrintFilePageGXInsertPrintFilePageGXDeletePrintFilePageRangeGXSavePrintFileWorking With Paper TypesGXNewPaperTypeGXDisposePaperTypeGXGetNewPaperTypeGXGetJobPaperTypeGXCountJobPaperTypesGXCopyPaperTypeGXGetPaperTypeNameGXGetPaperTypeDimensionsGXGetPaperTypeJobGXForEachJobPaperTypeDoFormatting for Specific DevicesGXSetAvailableJobFormatModesGXGetPreferredJobFormatModeGXGetJobFormatModeGXSetJobFormatModeGXJobFormatModeQueryColor Profile FunctionsGXFindPrinterProfileGXFindFormatProfileGXSetPrinterProfile9Table 4-6 The actions of the GXSetPrinterProfile functionGXSetFormatProfile8Table 4-7 The actions of the GXSetFormatProfile functionIdle Job Function GXIdleJobApplication-Defined Functions<Message Override Function for the Printing Status Dialog BoxGXJobStatus(Looping Through a Printer’s View Devices#Looping Through a Job’s Paper TypesThe Status ResourceFigure 4-3 The status resourceTable 4-8 Status types&Summary of Advanced Printing FeaturesGlossaryIndex